#ifndef _BATTERYSTATUSKEY_H_
#define _BATTERYSTATUSKEY_H_
#include "Sample_Thread.h"
#include "TimeOut.h"



#define BATTERYKEY_PORT		GPIOD
#define BATTERYKEY_PIN		GPIO_PIN_3
#define KEY_ANTI_SHAKE_TIME		30//ms


typedef enum
{
	KeyPress=0,
	PressDelay,
	KeyRelease,
	ReleaseDelay
}
KEY_STATUS;

typedef struct _key_status {
	spthd prvKey;
	TIMEOUT_PARA timeout;
	KEY_STATUS key_status ;
}
key_status ;




/*****************************************************************************
 * Function      : batteryStatusKey_init
 * Description   : battery status query key gpio init 
 * Input         : void  
 * Output        : None
 * Return        : 
 * Others        : 
 * Record
 * 1.Date        : 20170321
 *   Author      : bruce
 *   Modification: Created function

*****************************************************************************/
int batteryStatusKey_init(void);

/*****************************************************************************
 * Function      : batteryStatus_StructDeInit
 * Description   : reset battery struct data
 * Input         : void  
 * Output        : None
 * Return        : 
 * Others        : 
 * Record
 * 1.Date        : 20170321
 *   Author      : bruce
 *   Modification: Created function

*****************************************************************************/
int batteryStatusKey_DeInit(void);

enum battery_key_status
{
	btkey_idle = 0,
	btkey_rel ,
	btkey_press
};

/*****************************************************************************
 * Function      : batteryStatusKey_GetKeyStatus
 * Description   : get key statsu 
 * Input         : void  
 * Output        : None
 * Return        : enum
 * Others        : 
 * Record
 * 1.Date        : 20170321
 *   Author      : bruce
 *   Modification: Created function

*****************************************************************************/
int batteryStatusKey_GetKeyStatus(void);


#endif

